import {LogLanguage} from "../dist/index.js"

// 测试简单的字符串
const testCases = [
  '"simple string"',
  "'single quoted'",
  '`backtick string`'
]

console.log("Testing simple string recognition...")

testCases.forEach((testCase, index) => {
  console.log(`\nTest case ${index + 1}:`)
  console.log(`Input: ${testCase}`)
  
  try {
    const tree = LogLanguage.parser.parse(testCase)
    console.log("Parse successful!")
    
    // 检查所有节点
    console.log("All nodes:")
    tree.iterate({
      enter: (node) => {
        const text = testCase.slice(node.from, node.to)
        console.log(`- ${node.name}: "${text}"`)
      }
    })
    
  } catch (error) {
    console.log(`Parse failed: ${error.message}`)
  }
}) 